package com.hxd.otc.module.my.activity;

import android.content.Intent;
import android.view.View;

import com.hxd.otc.R;
import com.hxd.otc.base.BaseActivity;
import com.hxd.otc.module.home.activity.TicketListActivity;
import com.hxd.otc.module.my.contract.ContactCustomerContract;
import com.hxd.otc.module.my.presenter.ContactCustomerPresenter;
import com.hxd.otc.utils.hyphenate.HyphenateKeFuUtil;

import butterknife.OnClick;

public class ContactCustomerActivity extends BaseActivity<ContactCustomerPresenter> implements ContactCustomerContract.IView {
    @Override
    protected int getLayoutId() {
        return R.layout.activity_contact_customer;
    }

    @Override
    protected void initView() {
    }

    @Override
    protected void initData() {
    }

    @Override
    protected void initEvent() {
    }

    @Override
    protected ContactCustomerPresenter createPresenter() {
        return new ContactCustomerPresenter(this);
    }

    @OnClick({R.id.tv_customer_online, R.id.tv_customer_offline})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_customer_online:
                onLineChat();
                break;
            case R.id.tv_customer_offline:
                onOffLineChat();
                break;
        }
    }

    private void onLineChat() {
        HyphenateKeFuUtil.getInstance().onLineChat(this);
    }

    private void onOffLineChat() {
        Intent intent = new Intent(this, TicketListActivity.class);
        startActivity(intent);
    }
}
